package com.example.fabric.config;

import lombok.Getter;
import lombok.Setter;
import lombok.ToString;

import java.io.File;
import java.util.List;

@Getter
@Setter
@ToString
public class OrgConfig {
    private String name;
    private String org;
    private String orgId;
    private String certFile;
    private String skFilePath;
    private List<NodeInfo> peerList;

    public String getSkFile() {
        File file = new File(getSkFilePath());
        File[] tempList = file.listFiles();
        if (tempList == null || tempList.length < 1) {
            return "";
        }
        return getSkFilePath() + File.separator + tempList[0].getName();
    }
}
